#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	set<int> s;
	unordered_map<int, char> mp;

	int x, ch = 0;
	while (cin >> x) {
		mp[x] = ch + 'A', ch = (ch + 1) % 5;
		auto fg =  s.insert(x).second;
		if (!fg)
			s.erase(x);
	}
	cout << mp[*(s.begin())];
	return 0;
}
